package work728.work5;

public class Test {
  public static void main(String[] args) {
    Cat cat = new Cat("加菲猫",4);
    Duck duck = new Duck("唐小鸭",2);
    Dolphin dolphin = new Dolphin();
    dolphin.setName("海豚奇奇");
    Animal animal[] = new Animal[]{
      cat,
      duck,
      dolphin,
    };
    System.out.println("动物名字\t\t腿的条数\t\t动物叫声");
    for (Animal a:animal) {
      a.shout();
    }
  }
}
